import React from 'react'
import { BrowserRouter, useRoutes } from 'react-router-dom'
const Home = React.lazy(() => import('../pages/home'))
const MoreList = React.lazy(() => import('../pages/moreList'))

const routes = [{
	path: '/',
	element: <Home></Home>
},{
	path: '/more/list',
	element: <MoreList></MoreList>
}]

const Router = () => {
	function App() {
		const element = useRoutes(routes)
		return element
	}

	return (
		<BrowserRouter>
			<App></App>
		</BrowserRouter>
	)
}

export default Router